//
//  waitViewController.m
//  yutong
//
//  Created by Gao Haiming on 16/6/19.
//  Copyright © 2016年 ghm. All rights reserved.
//

#import "waitViewController.h"
#import "LoginViewController.h"
#import "UIView+SDAutoLayout.h"

#import "Comm.h"

@interface waitViewController ()

@property (strong, nonatomic) UIImageView *imageView;

@end

@implementation waitViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    [self initView];
    [self addAutoLayout];

    [self performSelector:@selector(enterNextView) withObject:nil afterDelay:3.0f];
}

- (void)initView
{
    self.view.backgroundColor = [UIColor whiteColor];

    self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:NSLocalizedString(@"pic", nil)]];
	self.imageView.contentMode = UIViewContentModeScaleAspectFit;

    [self.view addSubview:self.imageView];
}

- (void)viewWillAppear:(BOOL)animated
{
	[super viewWillAppear:animated];
	self.navigationController.navigationBarHidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated
{
	[super viewWillDisappear:animated];
	self.navigationController.navigationBarHidden = NO;
}

- (void)addAutoLayout
{
    self.imageView.sd_layout
	.spaceToSuperView(UIEdgeInsetsZero);
}

- (void) enterNextView
{
    LoginViewController* vc =
        (LoginViewController*)[Comm viewControllerId:@"LoginViewController" storyboard:@"Main"];

    vc.deviceDic = _deviceDic;
    [self.navigationController pushViewController:vc animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
